
import 'package:flutterlib/model/navigate/Sub.dart';

class Chainnode {
    String fullName;
    int id;
    String name;
    List<Sub> sub;

    Chainnode({this.fullName, this.id, this.name, this.sub});

    factory Chainnode.fromJson(Map<String, dynamic> json) {
        return Chainnode(
            fullName: json['fullName'], 
            id: json['id'], 
            name: json['name'], 
            sub: json['sub'] != null ? (json['sub'] as List).map((i) => Sub.fromJson(i)).toList() : null, 
        );
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        data['fullName'] = this.fullName;
        data['id'] = this.id;
        data['name'] = this.name;
        if (this.sub != null) {
            data['sub'] = this.sub.map((v) => v.toJson()).toList();
        }
        return data;
    }
}